package com.mxpio.erp.common.quality.entity;

import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.jpa.policy.impl.UUIDPolicy;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;

/**
 * @Author : wpp
 * @Datetime : 2023/6/6 14:32
 * @Desc :
 * @Modor :  Modifytime:
 * @modDesc : 质检单据
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_QUALITY_IB_CHECK_DETAIL")
@Schema(description="质检单据-样本-检测项-明细")
public class InspectionBillCheckDetail extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @Id
    @Generator(policy = UUIDPolicy.class)
    @Column(name = "ID_", length = 64)
    @Schema(description = "ID主键")
    private String id;

    @Column(name = "BIZ_NO_", updatable = false)
    @Schema(description = "质检单据编码")
    private String bizNo;

    @Column(name = "SIMPLE_CODE_", updatable = false)
    @Schema(description = "样本编号")
    private String simpleCode;

    @Column(name = "DETECT_CODE_", updatable = false)
    @Schema(description = "检测项编号")
    private String detectCode;

    @Column(name = "SORT_")
    @Schema(description = "顺序号")
    private Integer sort;


    //InspectionItem相关字段
    @Column(name = "II_CODE_", updatable = false)
    @Schema(description = "检测项目编号")
    private String inspectionItemCode;

    @Column(name = "II_NAME_")
    @Schema(description = "检测项目名称")
    private String inspectionItemName;

    @Column(name = "II_CLASS_")
    @Schema(description = "检测项目分类")
    @Dict(dicCode = "ERP_QUAL_II_CLASS")
    private String inspectionItemClass;

    @Column(name = "II_TYPE_")
    @Schema(description = "检测项目类型")
    @Dict(dicCode = "ERP_QUAL_II_TYPE")
    private String inspectionItemType;//定性2，定量1

    @Column(name = "II_DEFECT_GRADE_")
    @Schema(description = "检测项目缺陷等级")
    @Dict(dicCode = "ERP_QUAL_II_DEFECT_GRADE")
    private String inspectionItemDefectGrade;

    @Column(name = "II_STANDARD_")
    @Schema(description = "检验标准")
    private String inspectionItemStandard;

    @Column(name = "II_DETECTION_TOOL_")
    @Schema(description = "检测工具")
    private String inspectionItemDetectionTool;

    @Column(name = "II_DETECTION_METHOD_")
    @Schema(description = "检测方法")
    private String inspectionItemDetectionMethod;

    @Column(name = "II_TECHNICAL_REQUIREMENTS_")
    @Schema(description = "技术要求")
    private String inspectionItemTechnicalRequirements;

    //---schemeLine字段
    @Column(name = "COMPARATOR_")
    @Schema(description = "比较符")
    private String comparator;//

    @Column(name = "TARGET_VALUE_")
    @Schema(description = "目标值")
    private String targetValue;//目标值

    @Column(name = "UNITS_")
    @Schema(description = "单位")
    private String units;//单位

    @Column(name = "MAX_VALUE_")
    @Schema(description = "最大值")
    private String maxValue;//

    @Column(name = "MIN_VALUE__")
    @Schema(description = "最小值")
    private String minValue;
    //---schemeLine字段


    @Column(name = "MEASUREMENT_")
    @Schema(description = "实测值")
    private String measurement;

    @Column(name = "TEST_RESULT_")
    @Schema(description = "检验结论")
    @Dict(dicCode = "MB_QUALITY_CHECK_RESULT")//0不合格，1合格
    private String testResult;

    @Column(name = "MEMO_")
    @Schema(description = "备注")
    private String memo;

}
